From 79564f167613760342b29b708ec6876d66df880b Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 10 Jan 2008 14:58:51 +0000 Subject: [PATCH] google: now understands \xnn --- google.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/google.c b/google.c index 0496d6422..889405696 100644 --- a/google.c +++ b/google.c @@ -353,9 +353,8 @@ google_read(void) panel = strstr( dict, "panel:\""); panelofs = 7; } - tmp = panel; - while ( tmp ) { + while ( tmp ) { if ( qc == '"' ) { char *tmp1 = strstr( tmp, "\"points\":\"" ); if ( !tmp1 ) { @@ -420,6 +419,9 @@ google_read(void) if ( panel ) { panel += panelofs; end = strstr( panel, "/table>
"); } } - if ( end ) { char *to = panel; char *from = panel; @@ -472,6 +473,12 @@ google_read(void) *to++='>'; from += 6; } + else if ( !strncmp( from, "\\x", 2)) { + unsigned int c; + sscanf(from+2, "%2x", &c); + *to++ = (char)c; + from += 4; + } else if ( !strncmp( from, "\\'", 2)) { *to++ = '\''; from += 2; @@ -497,6 +504,7 @@ google_read(void) #if 0 { FILE *foo = fopen( "foo.xml", "w" ); + fprintf(foo, "\n", xhtml_entities ); fwrite( panel, sizeof(char), strlen(panel), foo ); fclose( foo ); } -- 2.30.2